﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainSite.Master" AutoEventWireup="True" CodeBehind="BusinessTargetManagement.aspx.cs" Inherits="BSCMFF.Web.Pages.BSC_Setup.Manager.BusinessTargetManagement" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" 
        Skin="Default" meta:resourcekey="RadAjaxLoadingPanel1Resource1">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" 
        LoadingPanelID="RadAjaxLoadingPanel1" HorizontalAlign="NotSet" 
        meta:resourcekey="RadAjaxPanel1Resource1">
        
    <telerik:RadGrid ID="RadGridStrategicTargets" runat="server" AutoGenerateHierarchy="True"
         DataSourceID="EntityDataSourceStrategicTargets" CellSpacing="0" 
        GridLines="None" AutoGenerateColumns="False" 
        onupdatecommand="RadGridStrategicTargets_UpdateCommand" 
        ondeletecommand="RadGridStrategicTargets_DeleteCommand" 
        oninsertcommand="RadGridStrategicTargets_InsertCommand" 
            meta:resourcekey="RadGridStrategicTargetsResource1">
            
         <ExportSettings IgnorePaging="True" ExportOnlyData="True" 
                FileName="Strategic Targets" ></ExportSettings>
            <MasterTableView CommandItemDisplay="Top" DataKeyNames="Strategic_Target_ID" 
                DataSourceID="EntityDataSourceStrategicTargets" EditMode="PopUp" 
                HierarchyLoadMode="Client">
                <DetailTables>
                    <telerik:GridTableView runat="server" CommandItemDisplay="Top" 
                        DataKeyNames="ID" DataSourceID="EntityDataSourceBusinessSolutions" 
                        EditMode="PopUp" HierarchyLoadMode="Client" 
                        meta:resourcekey="GridTableViewResource2">
                        <DetailTables>
                            <telerik:GridTableView runat="server" CommandItemDisplay="Top" 
                                DataKeyNames="KPI_ID" DataSourceID="EntityDataSourceKPIs" EditMode="PopUp" 
                                HierarchyLoadMode="Client" meta:resourcekey="GridTableViewResource1">
                                <ParentTableRelation>
                                    <telerik:GridRelationFields DetailKeyField="Solution_FK" MasterKeyField="ID" />
                                </ParentTableRelation>
                                <CommandItemSettings AddNewRecordText="Add new KPI" 
                                    ExportToPdfText="Export to PDF" ShowRefreshButton="False" />
                                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                                </RowIndicatorColumn>
                                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                                </ExpandCollapseColumn>
                                <Columns>
                                    <telerik:GridBoundColumn DataField="KPI_ID" DataType="System.Int32" 
                                        FilterControlAltText="Filter KPI_ID column" HeaderText="KPI_ID" 
                                        meta:resourcekey="GridBoundColumnResource1" ReadOnly="True" 
                                        SortExpression="KPI_ID" UniqueName="KPI_ID" Visible="False">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Name" 
                                        FilterControlAltText="Filter Name column" HeaderText="KPI" 
                                        meta:resourcekey="GridBoundColumnResource2" SortExpression="Name" 
                                        UniqueName="Name">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Description" 
                                        FilterControlAltText="Filter Description column" HeaderText="Description" 
                                        meta:resourcekey="GridBoundColumnResource3" SortExpression="Description" 
                                        UniqueName="Description">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Perspective.Name" 
                                        FilterControlAltText="Filter Perspective column" HeaderText="Perspective" 
                                        meta:resourcekey="GridBoundColumnResource4" SortExpression="Perspective" 
                                        UniqueName="Perspective">
                                    </telerik:GridBoundColumn>
                                    <telerik:GridButtonColumn CommandName="Edit" 
                                        FilterControlAltText="Filter column column" 
                                        meta:resourcekey="GridButtonColumnResource1" Text="Edit" UniqueName="column">
                                    </telerik:GridButtonColumn>
                                    <telerik:GridButtonColumn CommandName="Delete" 
                                        FilterControlAltText="Filter column1 column" 
                                        meta:resourcekey="GridButtonColumnResource2" Text="Delete" UniqueName="column1">
                                    </telerik:GridButtonColumn>
                                </Columns>
                                <EditFormSettings CaptionDataField="Name" CaptionFormatString="Edit KPI: {0}" 
                                    EditFormType="WebUserControl" InsertCaption="Add new KPI" 
                                    UserControlName="~/UserControls/Details/KPIDetails_new.ascx">
                                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                    </EditColumn>
                                    <PopUpSettings Modal="True" Width="600px" />
                                </EditFormSettings>
                            </telerik:GridTableView>
                        </DetailTables>
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="Strategic_Target_FK" 
                                MasterKeyField="Strategic_Target_ID" />
                        </ParentTableRelation>
                        <CommandItemSettings AddNewRecordText="Add new Business Solution" 
                            ExportToPdfText="Export to PDF" ShowRefreshButton="False" />
                        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                        </RowIndicatorColumn>
                        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                            Visible="True">
                        </ExpandCollapseColumn>
                        <Columns>
                            <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" 
                                FilterControlAltText="Filter Solution ID column" HeaderText="Solution_ID" 
                                meta:resourcekey="GridBoundColumnResource5" ReadOnly="True" SortExpression="ID" 
                                UniqueName="SolutionID" Visible="False">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Solution" 
                                FilterControlAltText="Filter Solution column" HeaderText="Solution" 
                                meta:resourcekey="GridBoundColumnResource6" SortExpression="Solution" 
                                UniqueName="Solution">
                            </telerik:GridBoundColumn>
                            <telerik:GridButtonColumn CommandName="Edit" 
                                FilterControlAltText="Filter column column" 
                                meta:resourcekey="GridButtonColumnResource3" Text="Edit" UniqueName="column">
                            </telerik:GridButtonColumn>
                            <telerik:GridButtonColumn CommandName="Delete" 
                                FilterControlAltText="Filter column1 column" 
                                meta:resourcekey="GridButtonColumnResource4" Text="Delete" UniqueName="column1">
                            </telerik:GridButtonColumn>
                        </Columns>
                        <EditFormSettings CaptionDataField="Solution" 
                            CaptionFormatString="Edit Business Solution: {0}" EditFormType="WebUserControl" 
                            InsertCaption="Add new Business Solution" 
                            UserControlName="~/UserControls/Details/BusinessSolutionDetails.ascx">
                            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                            </EditColumn>
                            <PopUpSettings Modal="True" Width="600px" />
                        </EditFormSettings>
                    </telerik:GridTableView>
                </DetailTables>
                <CommandItemSettings AddNewRecordText="Add New Strategic Target" 
                    ExportToPdfText="Export to PDF" ShowExportToCsvButton="True" 
                    ShowExportToExcelButton="True" ShowExportToPdfButton="True" 
                    ShowExportToWordButton="True" ShowRefreshButton="False" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" 
                    Visible="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="Strategic_Target_ID" 
                        DataType="System.Int32" 
                        FilterControlAltText="Filter Strategic_Target_ID column" 
                        HeaderText="Strategic_Target_ID" meta:resourcekey="GridBoundColumnResource7" 
                        ReadOnly="True" SortExpression="Strategic_Target_ID" 
                        UniqueName="Strategic_Target_ID" Visible="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Name" 
                        FilterControlAltText="Filter Name column" HeaderText="Target" 
                        meta:resourcekey="GridBoundColumnResource8" SortExpression="Name" 
                        UniqueName="Name">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Description" 
                        FilterControlAltText="Filter Description column" HeaderText="Description" 
                        meta:resourcekey="GridBoundColumnResource9" SortExpression="Description" 
                        UniqueName="Description">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Perspective.Name" 
                        FilterControlAltText="Filter Perspective column" HeaderText="Perspective" 
                        meta:resourcekey="GridBoundColumnResource10" SortExpression="Perspective" 
                        UniqueName="Perspective">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="ExpectedDate" DataFormatString="{0:d}" 
                        DataType="System.DateTime" FilterControlAltText="Filter ExpectedDate column" 
                        HeaderText="ExpectedDate" meta:resourcekey="GridBoundColumnResource11" 
                        SortExpression="ExpectedDate" UniqueName="ExpectedDate">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn CommandName="Edit" 
                        FilterControlAltText="Filter column column" 
                        meta:resourcekey="GridButtonColumnResource5" Text="Edit" UniqueName="column">
                    </telerik:GridButtonColumn>
                    <telerik:GridButtonColumn CommandName="Delete" 
                        FilterControlAltText="Filter column1 column" 
                        meta:resourcekey="GridButtonColumnResource6" Text="Delete" UniqueName="column1">
                    </telerik:GridButtonColumn>
                </Columns>
                <EditFormSettings CaptionDataField="Name" 
                    CaptionFormatString="Edit Strategic Target: {0}" EditFormType="WebUserControl" 
                    InsertCaption="Add new Strategic Target" 
                    UserControlName="~/UserControls/Details/StrategicTargetDetails.ascx">
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                    <PopUpSettings Modal="True" Width="600px" />
                </EditFormSettings>
            </MasterTableView>
        <FilterMenu EnableImageSprites="False"></FilterMenu>

        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu>
    </telerik:RadGrid>
</telerik:RadAjaxPanel>
    <asp:EntityDataSource ID="EntityDataSourceStrategicTargets" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="Strategic_Target" 
         Include="Perspective" EntityTypeFilter="" Select="">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EntityDataSourceBusinessSolutions" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableFlattening="False" EntitySetName="Business_Solution" 
        Where="@Strategic_Target_FK == it.Strategic_Target_FK" EnableDelete="True" 
        EnableInsert="True" EnableUpdate="True" EntityTypeFilter="" Select="">
        <WhereParameters>
            <asp:SessionParameter Type="Int32"  
                Name="Strategic_Target_FK" SessionField="Strategic_Target_FK" />
        </WhereParameters>
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="EntityDataSourceKPIs" runat="server" 
        ConnectionString="name=BSCEntities" DefaultContainerName="BSCEntities" 
        EnableDelete="True" EnableFlattening="False" EnableInsert="True" 
        EnableUpdate="True" EntitySetName="KPIs" Include="Perspective"
        Where="@Solution_FK == it.Solution_FK" EntityTypeFilter="" Select="" >
        <WhereParameters>
            <asp:SessionParameter Type="Int32"  
                Name="Solution_FK" SessionField="Solution_FK" />
        </WhereParameters>
    </asp:EntityDataSource>
</asp:Content>
